3.69 \(\int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=105 \[ -\frac {\sqrt {2} \sqrt {a} (A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d} \]

[Out]

-(A-I*B)*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))*2^(1/2)*a^(1/2)/d+2*A*(a+I*a*tan(d*x+c))^(1/2)/
d-2/3*I*B*(a+I*a*tan(d*x+c))^(3/2)/a/d

________________________________________________________________________________________

Rubi [A]  time = 0.14, antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3592, 3527, 3480, 206} \[ -\frac {\sqrt {2} \sqrt {a} (A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]]*(A + B*Tan[c + d*x]),x]

[Out]

-((Sqrt[2]*Sqrt[a]*(A - I*B)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/d) + (2*A*Sqrt[a + I*a*Tan
[c + d*x]])/d - (((2*I)/3)*B*(a + I*a*Tan[c + d*x])^(3/2))/(a*d)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3480

Int[Sqrt[(a_) + (b_.)*tan[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[(-2*b)/d, Subst[Int[1/(2*a - x^2), x], x, Sq
rt[a + b*Tan[c + d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0]

Rule 3527

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d*
(a + b*Tan[e + f*x])^m)/(f*m), x] + Dist[(b*c + a*d)/b, Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[{a, b, c,
d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] &&  !LtQ[m, 0]

Rule 3592

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(B*d*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e
 + f*x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b
*c - a*d, 0] &&  !LeQ[m, -1]

Rubi steps

\begin {align*} \int \tan (c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx &=-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d}+\int \sqrt {a+i a \tan (c+d x)} (-B+A \tan (c+d x)) \, dx\\ &=\frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d}-(i A+B) \int \sqrt {a+i a \tan (c+d x)} \, dx\\ &=\frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d}-\frac {(2 a (A-i B)) \operatorname {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=-\frac {\sqrt {2} \sqrt {a} (A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 A \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 i B (a+i a \tan (c+d x))^{3/2}}{3 a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 1.44, size = 132, normalized size = 1.26 \[ \frac {e^{-i (c+d x)} \sqrt {a+i a \tan (c+d x)} \left (-3 (A-i B) \left (1+e^{2 i (c+d x)}\right )^{3/2} \sinh ^{-1}\left (e^{i (c+d x)}\right )+6 A e^{i (c+d x)} \left (1+e^{2 i (c+d x)}\right )-4 i B e^{3 i (c+d x)}\right )}{3 d \left (1+e^{2 i (c+d x)}\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]]*(A + B*Tan[c + d*x]),x]

[Out]

(((-4*I)*B*E^((3*I)*(c + d*x)) + 6*A*E^(I*(c + d*x))*(1 + E^((2*I)*(c + d*x))) - 3*(A - I*B)*(1 + E^((2*I)*(c
+ d*x)))^(3/2)*ArcSinh[E^(I*(c + d*x))])*Sqrt[a + I*a*Tan[c + d*x]])/(3*d*E^(I*(c + d*x))*(1 + E^((2*I)*(c + d
*x))))

________________________________________________________________________________________

fricas [B]  time = 0.73, size = 336, normalized size = 3.20 \[ -\frac {3 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {{\left (8 \, A^{2} - 16 i \, A B - 8 \, B^{2}\right )} a}{d^{2}}} \log \left (\frac {{\left ({\left (4 i \, A + 4 \, B\right )} a e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {{\left (8 \, A^{2} - 16 i \, A B - 8 \, B^{2}\right )} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - 3 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {\frac {{\left (8 \, A^{2} - 16 i \, A B - 8 \, B^{2}\right )} a}{d^{2}}} \log \left (\frac {{\left ({\left (4 i \, A + 4 \, B\right )} a e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {{\left (8 \, A^{2} - 16 i \, A B - 8 \, B^{2}\right )} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - 8 \, \sqrt {2} {\left ({\left (3 \, A - 2 i \, B\right )} e^{\left (3 i \, d x + 3 i \, c\right )} + 3 \, A e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{12 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^(1/2)*tan(d*x+c)*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/12*(3*(d*e^(2*I*d*x + 2*I*c) + d)*sqrt((8*A^2 - 16*I*A*B - 8*B^2)*a/d^2)*log(((4*I*A + 4*B)*a*e^(I*d*x + I*
c) + sqrt(2)*(I*d*e^(2*I*d*x + 2*I*c) + I*d)*sqrt((8*A^2 - 16*I*A*B - 8*B^2)*a/d^2)*sqrt(a/(e^(2*I*d*x + 2*I*c
) + 1)))*e^(-I*d*x - I*c)/(I*A + B)) - 3*(d*e^(2*I*d*x + 2*I*c) + d)*sqrt((8*A^2 - 16*I*A*B - 8*B^2)*a/d^2)*lo
g(((4*I*A + 4*B)*a*e^(I*d*x + I*c) + sqrt(2)*(-I*d*e^(2*I*d*x + 2*I*c) - I*d)*sqrt((8*A^2 - 16*I*A*B - 8*B^2)*
a/d^2)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1)))*e^(-I*d*x - I*c)/(I*A + B)) - 8*sqrt(2)*((3*A - 2*I*B)*e^(3*I*d*x +
3*I*c) + 3*A*e^(I*d*x + I*c))*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1)))/(d*e^(2*I*d*x + 2*I*c) + d)

________________________________________________________________________________________

giac [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^(1/2)*tan(d*x+c)*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

Timed out

________________________________________________________________________________________

maple [A]  time = 0.26, size = 82, normalized size = 0.78 \[ \frac {-\frac {2 i B \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+2 A \sqrt {a +i a \tan \left (d x +c \right )}\, a -a^{\frac {3}{2}} \left (-i B +A \right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{d a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(d*x+c))^(1/2)*tan(d*x+c)*(A+B*tan(d*x+c)),x)

[Out]

2/d/a*(-1/3*I*B*(a+I*a*tan(d*x+c))^(3/2)+A*(a+I*a*tan(d*x+c))^(1/2)*a-1/2*a^(3/2)*(A-I*B)*2^(1/2)*arctanh(1/2*
(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2)))

________________________________________________________________________________________

maxima [A]  time = 1.12, size = 107, normalized size = 1.02 \[ \frac {3 \, \sqrt {2} {\left (A - i \, B\right )} a^{\frac {5}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) - 4 i \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {3}{2}} B a + 12 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} A a^{2}}{6 \, a^{2} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^(1/2)*tan(d*x+c)*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/6*(3*sqrt(2)*(A - I*B)*a^(5/2)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*tan(d*x + c) + a))/(sqrt(2)*sqrt(a) + sqrt(I
*a*tan(d*x + c) + a))) - 4*I*(I*a*tan(d*x + c) + a)^(3/2)*B*a + 12*sqrt(I*a*tan(d*x + c) + a)*A*a^2)/(a^2*d)

________________________________________________________________________________________

mupad [B]  time = 6.93, size = 120, normalized size = 1.14 \[ \frac {2\,A\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{d}-\frac {B\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{3/2}\,2{}\mathrm {i}}{3\,a\,d}+\frac {\sqrt {2}\,B\,\sqrt {-a}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{d}-\frac {\sqrt {2}\,A\,\sqrt {a}\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {a}}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i)^(1/2),x)

[Out]

(2*A*(a + a*tan(c + d*x)*1i)^(1/2))/d - (B*(a + a*tan(c + d*x)*1i)^(3/2)*2i)/(3*a*d) + (2^(1/2)*B*(-a)^(1/2)*a
tan((2^(1/2)*(a + a*tan(c + d*x)*1i)^(1/2))/(2*(-a)^(1/2)))*1i)/d - (2^(1/2)*A*a^(1/2)*atanh((2^(1/2)*(a + a*t
an(c + d*x)*1i)^(1/2))/(2*a^(1/2))))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \left (A + B \tan {\left (c + d x \right )}\right ) \tan {\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))**(1/2)*tan(d*x+c)*(A+B*tan(d*x+c)),x)

[Out]

Integral(sqrt(I*a*(tan(c + d*x) - I))*(A + B*tan(c + d*x))*tan(c + d*x), x)

________________________________________________________________________________________